gather (one's) wits

Translations
собраться с мыслями
He took a moment to gather his wits before responding to the question.
Он взял минуту, чтобы собраться с мыслями, прежде чем ответить на вопрос.
Definitions
To collect or compose one's thoughts, especially after being surprised, confused, or shocked, in order to think or act clearly.